#ifndef __comm_param_h__
#define __comm_param_h__ 1
#include "cJSON.h"
typedef struct comm_req_param_s{
    char developerKey[64];
    char mac[32];
    char currentTime[32];
    char clientType[16];
    int collectType;
    int cmdId;
    int status;
    int code;
    char msg[64];
    char probeId[64];
    char version[64];

    char cityName[32];
    char cityAlias[32];
    char cityId[32];
    char province[32];
    char dial_bdaccount[32];//实际拨号上网账号
    char bdaccount[32];//带宽账号
    char bdpassword[32];//带宽密码
    char bdcode[32];//带宽字符串
    int bdcode_val;//
}comm_req_param_t;

typedef struct{
    char status[32];
    char msg[64];
    char code[16];
}comm_resp_param_t;

extern comm_req_param_t commReqParam;

void crq_clone(comm_req_param_t* dist, comm_req_param_t* comm_req);
void crq_set_devkey(comm_req_param_t* crq, char* key);
void crq_set_mac(comm_req_param_t* crq, char* mac);
void crq_set_currentTime(comm_req_param_t* crq);
void crq_set_clientType(comm_req_param_t* crq, char* clientType);
void crq_set_collectType(comm_req_param_t* crq, int collectType);
void crq_set_cmdId(comm_req_param_t* crq, int cmdId);
void crq_set_status(comm_req_param_t* crq, int status);
void crq_set_code(comm_req_param_t* crq, int code);
void crq_set_msg(comm_req_param_t* crq, char* msg);
void crq_set_probeId(comm_req_param_t* crq, char* probeId);
void crq_set_version(comm_req_param_t* crq, char* version);
cJSON* crq2cjson(comm_req_param_t* crq, cJSON* root);
void load_probe_version(char *file, char* buffer, int len);
void save_probe_version(char *file, char* buffer, int len);
int check_platform_resp(cJSON* root);
#endif